{include file="public/header"}
<body>
	<div class="sectionY">
		<a href="javascript:history.back();">
			<img src="__PUBLIC__/home/images/a19.png" alt="" class="a1">
		</a>
		<p class="p1">我的地址</p>
		<a href="javascript:addAddress();" class="a3">新增地址</a>
	</div>
	<div class="kong1" style=""></div>
	<div class="zhi_section1">
		{if !empty($list)}
		{foreach $list as $item}
		<div class="f1 clearfix">
			<a href="javascript:;">
				<div class="left" onclick="selecteAddress('{$item.id}')">
					<p class="p1">
						<span class="s1">{$item.name}</span>
						<span class="s2">{$item.mobile}</span>
						{if $item.is_def eq 1}
						<span class="s3">默认</span>
						{/if}
					</p>
					<p class="p2">{$item.procity}{$item.address}</p>
				</div>
				<div class="right" onclick="goEditAddress('{$item.id}')">
					<img src="__PUBLIC__/home/images/a39.png" alt="">
				</div>
			</a>
		</div>
		{/foreach}
		{else/}
		<div class="f1 clearfix" style="text-align: center;">
			<span>暂无收获地址</span>
		</div>
		{/if}
	</div>
</body>
<script>
	var redirect_url = "{$redirect_url}";
	function addAddress() {
		if(redirect_url != ""){
			location.href = "{:url('User/addAddress')}?redirect_url="+redirect_url;
		}else{
			location.href = "{:url('User/addAddress')}";
		}
	}

	function goEditAddress(address_id) {
		if(redirect_url != ""){
			location.href = "{:url('User/editAddress')}?redirect_url="+redirect_url+"&address_id="+address_id;
		}else{
			location.href = "{:url('User/editAddress')}?address_id="+address_id;
		}
	}

	function selecteAddress(address_id) {
		if(redirect_url != ""){
			location.href = "{:url('selectAddress')}?redirect_url="+redirect_url+"&address_id="+address_id;
		}
	}
	
</script>
</html>